<html>
 <head> 
 <title>历史数据训练</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="../styles/style.css" type="text/css" />
<link rel="stylesheet" href="../styles/table.css" type="text/css" />

<script src="../script/common.js"></script>
<script>
$import("util.js");
$import("rpc.js");
$import("table_list.js");
$import("html/format.js");
$import("html/form.js");
$import("html/validate.js");
$import("My97DatePicker/WdatePicker.js");

function dataValidation()
{
	var validators = 
	{
		"name": new ruite.form.StringEmptyValidator("训练集名称"),
		"historyDataStartTime": new ruite.form.DateValidator("历史数据开始时间"),
		"historyDataEndTime": new ruite.form.DateValidator("历史数据结束时间")
	};
	if (!ruite.form.validate($("train_form"), validators)) return false;

	var beginDate=document.getElementById("historyDataStartTime").value;
	var endDate=document.getElementById("historyDataEndTime").value;
	if(!ruite.form.compareDate(beginDate,endDate))
	{
		alert("终止日期不能早于起始日期！");
		return false;
	}
	
	return true;
}

function onTrain()
{
	if (!dataValidation()) return false;
	var callback = function(data)
	{
		alert("训练完毕！");
		location.href = "train_result_list.jsp";
	}
	var trainSet = {};
	var parsers = 
    {
    	"historyDataStartTime": ruite.parse.date,
        "historyDataEndTime": ruite.parse.date
    };
	trainSet = ruite.form.encode($("train_form"), parsers);

	//训练开始，禁用“开始训练”的按钮，显示等待的图片和提示
	//$('trainButton').style.display = "none";
	//$('loadingSapn').style.display = "";
	
	var opration = new Operation("排班.预测.话务量.训练"); 
	opration.trainSet = trainSet;
	opration.execute(callback);
	
}

function onLoad()
{
	var callback = function(data)
	{
		var projectList = [];
		projectList = data.projectList;

		dwr.util.removeAllOptions('projectId');
		dwr.util.addOptions('projectId', projectList, "id", "name");
	}

	var operation = new Operation("排班.预测.获取预测页面公用显示信息");
	operation.execute(callback);
}

var option_titles = new Array(
	'胃痛或肚子痛',
	'背痛',
	'四肢或关节疼痛',
	'痛经或经期其他问题（限女生填写）',
	'头痛',
	'胸痛',
	'头晕、头昏',
	'短时间晕倒',
	'感觉心跳剧烈或加速',
	'呼吸急促',
	'性交疼痛或存在其他问题',
	'便秘、腹泻或痢疾',
	'恶心、胃肠道胀气或消化不良',
	'感觉疲乏或精力不足',
	'睡眠问题'
);

</script>
 </head>
<body onLoad="">

<div id="ur_here"><img src="../images/icon_here.gif" style="align:absmiddle"/> 当前位置：首页 » 在线考试 </div>
<div id="wrap">
<div id="containaer">

			<div class="title">试题1</div>
			<div id="tab_content_0" class="tab_content" style="">
			
				<table cellpadding=0 cellspacing=0 border=0 width="100%" class="form_table">
					<tr class='tablecell'>
						<td class="tit">题目：</td>
						<td>在最近30天中，您在多大程度上受到以下问题的困扰？</td>
					</tr>
					<script type="text/javascript">
					for(var i in option_titles){
						document.write('<tr class="tablecell">');
						document.write('<td class="tit" width="200px">' + option_titles[i] + '</td>');
						document.write('<td><label><input type="radio" id="ques[1]['+i+']" name="ques[1]['+i+']" value="0" />没有困扰</label>');
						document.write('<label><input type="radio" id="ques[1]['+i+']" name="ques[1]['+i+']" value="1" />有些困扰</label>');
						document.write('<label><input type="radio" id="ques[1]['+i+']" name="ques[1]['+i+']" value="2" />很大困扰</label></td>');
						document.write('</tr>');
					}
					</script>
				</table>

				<div class="single_question">
					<div class="content">在最近的12个月中，是否曾有一个月您受到上述问题的困扰比最近30天更为严重？</div>
					<div class="options">
						<button type="button" class="normal">是</button>
						<button type="button" class="normal">否</button>
					</div>
				</div>
				
				<fieldset class="tips">
					<legend>操作提示:</legend>
					<ul>
						<li>根据题目选择您认为正确的答案</li>
						<li>点击“下一题”继续答题</li>
					</ul>
				</fieldset>
			</div>
			
</div></div>
</body>
</html>
 